package com.lggry.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//lombak技术可以实现为类自动添加getter/setter/toString/equals/hashCode/requiredArgsConstructor等方法
@Data   // lombok注解，自动生成getter/setter/toString/equals/hashCode/requiredArgsConstructor等方法
@NoArgsConstructor
@AllArgsConstructor

public class Card {
    private String cardId;
    private String name;
    private String phone;
    private double money;

    //存储金额
    public void deposit(double money){
        this.money += money;
    }
    //消费金额
    public void consume(double money){
        this.money -= money;
    }
}
